<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="org.springframework.security.core.Authentication"%>
<%@ page
	import="org.springframework.security.core.context.SecurityContextImpl"%>
<%@ page import="org.springframework.security.web.WebAttributes"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/common/meta.jsp"></jsp:include>
<jsp:include page="/common/css_js.jsp"></jsp:include>
<%
	if (session.getAttribute(WebAttributes.AUTHENTICATION_EXCEPTION) != null) {
		response.sendRedirect(request.getContextPath() + "/login.jsp");
		return;
	}

	Object securityContent = session
			.getAttribute("SPRING_SECURITY_CONTEXT");
	if (securityContent == null) {
		response.sendRedirect(request.getContextPath() + "/login.jsp");
		return;
	}
	SecurityContextImpl security = (SecurityContextImpl) securityContent;
	Authentication auth = security.getAuthentication();
	if (auth == null) {
		response.sendRedirect(request.getContextPath() + "/login.jsp");
		return;
	}
	String userName = auth.getName();
	if (userName == null) {
		response.sendRedirect(request.getContextPath() + "/login.jsp");
		return;
	}
	request.setAttribute("userName", userName);
%>
</head>
<frameset rows="64,*" frameborder="NO" border="0" framespacing="0">
	<frame src="${ctx }/admin/top.jsp" noresize="noresize" frameborder="0"
		name="topFrame" scrolling="no" marginwidth="0" marginheight="0" />
	<frameset cols="200,*" rows="560,*" id="frame">
		<frame src="${ctx }/admin/left.jsp" name="leftFrame"
			noresize="noresize" marginwidth="0" marginheight="0" frameborder="0"
			scrolling="no" />
		<frame src="${ctx }/admin/welcome.jsp" name="content" marginwidth="0"
			marginheight="0" frameborder="0" scrolling="auto" />
	</frameset>
</frameset>
<noframes>
	<body></body>
</noframes>

</html>
